<?php 
	/**
	*	创建人类
	*/
	class Person {

		//成员属性
		public $name;
		public $age;
		public $sex;

		public function __construct($name="", $age=0, $sex="男")
		{
			$this->name = $name;
			$this->age  = $age;
			$this->sex  = $sex;

			$this->left();
			$this->left();

			$this->right();
			$this->right();

			$this->go();
			$this->go();
			$this->go();
		}

		private function say(){
			echo "大家好！我叫：{$this->name}我的年龄是：{$this->age}我的性别是{$this->sex}<br>";
		}

		private function left(){
			echo "向左走<br>";
		}

		private function right(){
			echo "向右走<br>";
		}

		private function go(){
			echo "向前走<br>";
		}

		public function run() {

		}

		public function eat(){
			$this->say();
		}

		public function __destruct(){
			echo "再见!{$this->name}<br>";
		}
	}

	$a = new Person("黄碧雯", 20, "女");

	echo $a->eat();













 ?>